﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoUpdateMgr.Mgr.Handler
{
    using System.IO;
    using AutoUpdate.Model.Packet;
    public class uploadFileHandler : Handler
    {
        public uploadFileHandler()
        {
            this.name = "uploadFile";
        }

        public override void doAction(Packet packet)
        {

            AutoUpdate.Model.Model.fileTransfer.fs_inodeContent inodeModel = AutoUpdate.Utility.Helper.JsonHelper.getObject<AutoUpdate.Model.Model.fileTransfer.fs_inodeContent>(packet.MessageContent);

            if (inodeModel != null)
            {
                Action<AutoUpdate.Model.Packet.Packet> callback = ActionMgr.getInstance().getAction(packet.PacketID);

                if (callback != null)
                {
                    callback(packet);
                }

            }
        }
    }
}
